<!--订单进度-->
<div style="height:15px;"></div>
<table class="layui-table" id="ddjd_table">
<thead>
	<tr class="layui-bg-orange">
		<th width="20%"><a href="javascript:showDetail('采购中-订单列表', '{:url('ddjdTableDetail', 'types=caigou&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">采购中</a></th>
		<th width="20%"><a href="javascript:showDetail('面料处理-订单列表', '{:url('ddjdTableDetail', 'types=mianliao&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">面料处理</a></th>
		<th width="15%"><a href="javascript:showDetail('裁剪中-订单列表', '{:url('ddjdTableDetail', 'types=caijian&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">裁剪中</a></th>
		<th width="15%"><a href="javascript:showDetail('车缝中-订单列表', '{:url('ddjdTableDetail', 'types=chefen&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">车缝中</a></th>
		<th width="15%"><a href="javascript:showDetail('尾部中-订单列表', '{:url('ddjdTableDetail', 'types=tail&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">尾部中</a></th>
		<th width="15%"><a href="javascript:showDetail('JIT-订单列表', '{:url('ddjdTableDetail', 'types=jit&factory_id='.$thisFactoryId.'&from='.$thisFrom)}')"  style="text-decoration:underline">JIT数</a></th>
	</tr>
</thead>
<tbody>
<tr>
	<td class="value" style="text-decoration:underline;cursor:pointer;" onclick="getChart7daysJianshu('caigou')">
		0件/0单<br>
		昨日：0件/0单
	</td>
	<td class="value" style="text-decoration:underline;cursor:pointer;" onclick="getChart7daysJianshu('mianliao')">
		0件/0单<br>
		昨日：0件/0单
	</td>
	<td class="value" style="text-decoration:underline;cursor:pointer;" onclick="getChart7daysJianshu('caijian')">
		0件/0单<br>
		昨日：0件/0单
	</td>
	<td class="value" style="text-decoration:underline;cursor:pointer;;" onclick="getChart7daysJianshu('chefen')">
		0件/0单<br>
		昨日：0件/0单
	</td>
	<td class="value" style="text-decoration:underline;cursor:pointer;" onclick="getChart7daysJianshu('tail')">
		0件/0单<br>
		昨日：0件/0单
	</td>
	<td class="value">
		0件/0单
	</td>
	</tr>
</tbody>
</table>
<div id="chart_7days_jianshu"></div>
<div id="chart_ddjd_7days_jianshu"></div>
<script type="text/javascript">
	var ddjd_table_data={type:'',create_date_range:''};
	layui.use([ 'element', 'layer', 'laytpl', 'tool','laydate','table','form','flow'], function() {
		var element = layui.element;
		var layer = layui.layer;
		var $ = layui.jquery;
		var form = layui.form;
		var laytpl = layui.laytpl,laydate=layui.laydate ,table = layui.table;
		var flow = layui.flow;

		set_ddjd_table();
	});

	//表格数据设置
	function set_ddjd_table() {
		$.ajax({
			type: "POST",
			url: "{:url('ddjd')}",
			data: "factory_id="+factoryId+"&from="+from+"&types=",
			dataType:"json",
			success: function(res){
				ddjd_table_data=res.data;
				var d;
				d=res.data.table.caigou;
				$('#ddjd_table').find('.value:eq(0)').html(d.all.jian+'件/'+d.all.num+'单<br>' +
						'昨日：'+d.yestoday.jian+'件/'+d.yestoday.num+'单');
				d=res.data.table.mianliao;
				$('#ddjd_table').find('.value:eq(1)').html(d.all.jian+'件/'+d.all.num+'单<br>' +
						'昨日：'+d.yestoday.jian+'件/'+d.yestoday.num+'单');
				d=res.data.table.caijian;
				$('#ddjd_table').find('.value:eq(2)').html(d.all.jian+'件/'+d.all.num+'单<br>' +
						'昨日：'+d.yestoday.jian+'件/'+d.yestoday.num+'单');
				d=res.data.table.chefen;
				$('#ddjd_table').find('.value:eq(3)').html(d.all.jian+'件/'+d.all.num+'单<br>' +
						'昨日：'+d.yestoday.jian+'件/'+d.yestoday.num+'单');
				d=res.data.table.tail;
				$('#ddjd_table').find('.value:eq(4)').html(d.all.jian+'件/'+d.all.num+'单<br>' +
						'昨日：'+d.yestoday.jian+'件/'+d.yestoday.num+'单');
				d=res.data.table.jit;
				$('#ddjd_table').find('.value:eq(5)').html(d.all.jian+'件/'+d.all.num+'单' );
			}
		});
	}

	function getChart7daysJianshu(type) {
		var chart_data={};
		$.each(ddjd_table_data.highcharts_data,function (i,n) {
			if(i==type){
				chart_data=n.highcharts_data.chart;
			}
		});
		var chart_order_delivery_last_month = Highcharts.chart('chart_ddjd_7days_jianshu', chart_data);
	}
</script>